#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>

int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) {
    int* p = (int*)calloc(numsSize+1, sizeof(int));
    int* x = (int*)malloc(sizeof(int) * (numsSize+1));
    int i = 0;
    int flag = 0;
    int num = 0;
    *returnSize = 0;
    for (i = 0; i < numsSize; i++)
    {
        if (nums[i] <= numsSize)
        {
            p[nums[i]]++;
        }
    }
    for (i = 1; i <= numsSize; i++)
    {
        if (p[i] == 0)
        {
            x[num++] = i;
        }
    }
    *returnSize = num;
    free(p);
    p = NULL;
    return x;
}

int main()
{
    int returnSize = 0;
    int nums[2] = { 1,1 };
    int* x=findDisappearedNumbers(nums, 2, &returnSize);
    for (int i = 0; i < returnSize; i++)
    {
        printf("%d", x[i]);
    }
    free(x);
    x = NULL;
    return 0;
}